package cn.iocoder.yudao.module.biz.dal.mysql.expand.targets;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.biz.dal.dataobject.expand.targets.ExpandTargetDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.biz.controller.admin.expand.targets.vo.*;


/**
 * 拓展目标 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface ExpandTargetMapper extends BaseMapperX<ExpandTargetDO> {

    default PageResult<ExpandTargetDO> selectPage(ExpandTargetPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ExpandTargetDO>()
                .likeIfPresent(ExpandTargetDO::getName, reqVO.getName())
                .eqIfPresent(ExpandTargetDO::getType, reqVO.getType())
                .eqIfPresent(ExpandTargetDO::getDetailId, reqVO.getDetailId())
                .likeIfPresent(ExpandTargetDO::getDirectorName, reqVO.getDirectorName())
                .eqIfPresent(ExpandTargetDO::getContactNumber, reqVO.getContactNumber())
                .eqIfPresent(ExpandTargetDO::getAddress, reqVO.getAddress())
                .eqIfPresent(ExpandTargetDO::getOwnerUserId, reqVO.getOwnerUserId())
                .likeIfPresent(ExpandTargetDO::getOwnerUserName, reqVO.getOwnerUserName())
                .betweenIfPresent(ExpandTargetDO::getLastExpandTime, reqVO.getLastExpandTime())
                .betweenIfPresent(ExpandTargetDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ExpandTargetDO::getId));
    }


    //List<ExpandTargetDO> selectAllExpandTarget(ExpandTargetPageReqVO reqVO);

}